package jjn.acwing.java_basic;

import java.util.Scanner;

/**
 * @author Jjn
 * @since 2023/8/18 11:31
 */
public class Acwing667 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        if (a == b) {
            System.out.printf("O JOGO DUROU %d HORA(S)%n", 24);
            return;
        }
        if (a > b) {
            System.out.printf("O JOGO DUROU %d HORA(S)%n", 24 - a + b);
            return;
        }
        System.out.printf("O JOGO DUROU %d HORA(S)%n", a - b);
    }
}
